package com.ljh.onlinetest.configuration.spring.security;

import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices;

import javax.servlet.http.HttpServletRequest;

/**
 * @author ljh
 * @ClassName RestTokenBasedRememberMeServices.java
 * @createTime 2021年12月28日
 * 记住我，cookie
 */
public class RestTokenBasedRememberMeServices extends TokenBasedRememberMeServices {
    public RestTokenBasedRememberMeServices(String key, UserDetailsService userDetailsService) {
        super(key, userDetailsService);
    }

    @Override
    protected boolean rememberMeRequested(HttpServletRequest request, String parameter) {
        String parameter1 = request.getParameter(DEFAULT_PARAMETER);
        return Boolean.parseBoolean(parameter1);
    }
}
